﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
namespace MyWeb.Data
{
	public class tblImgSizeDAL : SqlDataProvider
	{

		#region[tblImgSize_GetbyAll]
		public DataTable tblImgSize_GetByAll()
		{
			using (var cmd = new SqlCommand("sp_tblImgSize_GetByAll", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgSize_GetbyId]
		public DataTable tblImgSize_GetById(tblImgSizeInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgSize_GetById", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_sid", Data._sid));
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgSize_GetbyTop]
		public DataTable tblImgSize_GetByTop(string Top, string Where, string Order)
		{
			using (var cmd = new SqlCommand("sp_tblImgSize_GetByTop", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				cmd.Parameters.Add(new SqlParameter("@Top",Top));
				cmd.Parameters.Add(new SqlParameter("@Where",Where));
				cmd.Parameters.Add(new SqlParameter("@Order",Order));
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblImgSize_Insert]
		public void tblImgSize_Insert(tblImgSizeInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgSize_Insert", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_swidth", Data._swidth));
				cmd.Parameters.Add(new SqlParameter("@_sheight", Data._sheight));
				cmd.Parameters.Add(new SqlParameter("@_sprice", Data._sprice));
				cmd.ExecuteNonQuery();
			}
		}
		#endregion
		#region[tblImgSize_Update]
		public void tblImgSize_Update(tblImgSizeInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgSize_Update", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_sid", Data._sid));
				cmd.Parameters.Add(new SqlParameter("@_swidth", Data._swidth));
				cmd.Parameters.Add(new SqlParameter("@_sheight", Data._sheight));
				cmd.Parameters.Add(new SqlParameter("@_sprice", Data._sprice));
				cmd.ExecuteNonQuery();
			}
		}
		#endregion
		#region[tblImgSize_Delete]
		public void tblImgSize_Delete(string Data)
		{
			using (var cmd = new SqlCommand("sp_tblImgSize_Delete", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@_sid", Data));
				cmd.ExecuteNonQuery();
			}
		}
		#endregion
	}
}